From 8e4602ad131946e6869c55f601894d142358a8f2 Mon Sep 17 00:00:00 2001 From: justbur Date: Mon, 10 Aug 2015 09:09:59 -0400 Subject: [PATCH] Add missing save-match-data call --- which-key.el | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/which-key.el b/which-key.el index 81873eb486c..79f51c576a2 100644 --- a/which-key.el +++ b/which-key.el @@ -868,17 +868,18 @@ BUFFER that follow the key sequence KEY-SEQ." (let ((key-str-qt (regexp-quote (key-description which-key--current-prefix))) (buffer (current-buffer)) key-match desc-match unformatted) - (with-temp-buffer - (describe-buffer-bindings buffer which-key--current-prefix) - (goto-char (point-max)) ; want to put last keys in first - (while (re-search-backward - (format "^%s \\([^ \t]+\\)[ \t]+\\(\\(?:[^ \t\n]+ ?\\)+\\)$" - key-str-qt) - nil t) - (setq key-match (match-string 1) - desc-match (match-string 2)) - (cl-pushnew (cons key-match desc-match) unformatted - :test (lambda (x y) (string-equal (car x) (car y)))))) + (save-match-data + (with-temp-buffer + (describe-buffer-bindings buffer which-key--current-prefix) + (goto-char (point-max)) ; want to put last keys in first + (while (re-search-backward + (format "^%s \\([^ \t]+\\)[ \t]+\\(\\(?:[^ \t\n]+ ?\\)+\\)$" + key-str-qt) + nil t) + (setq key-match (match-string 1) + desc-match (match-string 2)) + (cl-pushnew (cons key-match desc-match) unformatted + :test (lambda (x y) (string-equal (car x) (car y))))))) (when which-key-sort-order (setq unformatted (sort unformatted (lambda (a b) (funcall which-key-sort-order a b))))) -- 2.30.2